﻿using ReflectionStudio.Core.Events;
using System;
using System.Data;
using System.Data.OracleClient;
using System.Collections;
using System.Collections.Generic;
using System.Linq;

namespace INTEX.DataBase.Tools
{
    public partial class INTEXBL
    {
        public bool ValidateArticle(object p1 = null, object p2 = null, object p3 = null, object p4 = null, object p5 = null, object p6 = null)
        {
            bool IsValid = true;
            DataSet Result = new DataSet();
            DataSet Return = new DataSet();
            DataRow dwData = null;
            string SetDate = "";
            string ARTSTAGE = (string)p1;
            string ART = (string)p2;
            string VAR = (string)p3;
            string COLOR = (string)p4;
            string FINISH = (string)p5;
            DataSet SetData = (DataSet)p6;
            string filter = "";
            DataRow[] rows = null;
            try
            {
                switch (ARTSTAGE)
                {
                    case "F":
                        break;
                    case "R":
                        break;
                    case "K":
                        break;
                    case "G":
                        filter = "GSART='" + ART + "' AND GSVAR='" + VAR + "'";
                        rows = SetData.Tables["GSDAT"].Select(filter); 
                        if (rows.Length == 0)
                        {
                            throw new System.Exception(ART.Trim() + "." + VAR + "没有对应的纱线工艺!");
                        }
                        break;
                }
            }
            catch (Exception ex)
            {
                Tracer.Error(ex.StackTrace, ex);
                IsValid = false;
            }
            return IsValid;
        }
    }
}

